package sebastiankerckhof;

import java.util.Scanner;
import java.util.regex.MatchResult;

import sebastiankerckhof.io.ParserUtils;
import sebastiankerckhof.io.exception.ParseException;
public class Test {

	/**
	 * @param args
	 * @throws ParseException 
	 */
	public static void main(String[] args) throws ParseException {

		
		System.out.println(ParserUtils.parseVector3f(" -1.000000 -0.000000 1.000000"));
		String input = "v -1.000000 -0.000000 1.000000\n"+
							"v 1.000000 -0.000000 1.000000\n"+
						"v -1.000000 0.000000 -1.000000\n"+
            "v 1.000000 0.000000 -1.000000\n"+
            "vt 0.000000 0.000000\n"+
            "vt 1.000000 0.000000\n"+
            "vt 0.000000 1.000000\n"+
            "vt 1.000000 1.000000\n"+
            "vn 0.000000 1.000000 0.000000\n"+
            "vn 0.000000 1.000000 0.000000\n"+
            "vn 0.000000 1.000000 0.000000\n"+
            "vn 0.000000 1.000000 0.000000\n"+
						"f 1/1/1 2/2/2 3/3/3\n"+
						"f 2/2/2 4/4/4 3/3/3";
    Scanner s = new Scanner(input);
   // s.useDelimiter("\\n");
    while(s.hasNext()){
    	String str = s.next();
    	System.out.println(str);
    	if(str.equals("v")){
    		s.findInLine("v (-*\\d*.\\d*\\s*)*");
    		 MatchResult result = s.match();
    		 System.out.println(result.group(1));
    	}
    }
	}

}
